package com.javaee.dao;

import com.javaee.domain.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ProductDao {
    @Select("select * from product where id=#{id}")
    Product findById(String id);

    @Update("update product set name = #{name} , stock = #{stock} where id = #{id} ")
    void update(Product product);
    @Delete("delete from product where id = #{id}")
    void remove(String id);

    @Insert("insert into product(id,name.stock)values (#{id},#{name},#{stock})")
    void add(Product product);
}
